"""
线程示例
"""
import threading
from time import sleep
import os

a = 1
# 线程函数
def music():
    global a
    for i in range(5):
        sleep(2)
        print(os.getpid(),'播放心如止水')
    a = 10000

if __name__ == "__main__":
    t = threading.Thread(target=music)
    t.start()
    # 主线程任务
    for i in range(3):
        sleep(3)
        print(os.getpid(),'播放跳舞吧')
    t.join()
    print('a=',a)
